﻿using Dal;
using Dal.Iterfease;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace xiaomiApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class CommodController : ControllerBase
    {
        private readonly Icommod _userDal;

        public CommodController(Icommod userDal)
        {
            _userDal = userDal;
        }

        /// <summary>
        /// 首页商品展示
        /// </summary>
        /// <returns></returns>
        [HttpGet, Route("ShowCommodl")]
        public IActionResult ShowCommodl(int? Cid)
        {
            return Ok(_userDal.ShowCommodl(Cid));
        }

        /// <summary>
        /// 详情页轮播图
        /// </summary>
        /// <param name="Cid"></param>
        /// <returns></returns>
        [HttpGet, Route("showimgs")]
        public IActionResult showimgs(int Cid)
        {
            return Ok(_userDal.showimgs(Cid));
        }


    }
}
